package com.ztc.plane;

import java.awt.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by ztc on 15-11-29.
 */
public class Util {
    public static ArrayList<Bullet> bullets=new ArrayList<Bullet>();
    //ConcurrentHashMap会自己检查修改操作
    public static ConcurrentHashMap<String,Plane> planes=new ConcurrentHashMap<String, Plane>();
    public static Image getImage(String path){
        Image img=Toolkit.getDefaultToolkit().getImage(Util.class.getClassLoader().getResource(path));
        return img;
    }
    public static void enemyRun(){
        Iterator iterator=planes.keySet().iterator();
        while(iterator.hasNext()){
            new Thread(planes.get(iterator.next())).start();
        }
    }

}
